﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.GraphicsSettings
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Script interface for.</para>
  /// </summary>
  [NativeHeader("Runtime/Camera/GraphicsSettings.h")]
  [StaticAccessor("GetGraphicsSettings()", StaticAccessorType.Dot)]
  public sealed class GraphicsSettings : Object
  {
    private GraphicsSettings()
    {
    }

    /// <summary>
    ///   <para>Transparent object sorting mode.</para>
    /// </summary>
    public static extern TransparencySortMode transparencySortMode { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>An axis that describes the direction along which the distances of objects are measured for the purpose of sorting.</para>
    /// </summary>
    public static Vector3 transparencySortAxis
    {
      get
      {
        Vector3 ret;
        GraphicsSettings.get_transparencySortAxis_Injected(out ret);
        return ret;
      }
      set => GraphicsSettings.set_transparencySortAxis_Injected(ref value);
    }

    /// <summary>
    ///   <para>Is the current render pipeline capable of rendering direct lighting for rectangular area Lights?</para>
    /// </summary>
    public static extern bool realtimeDirectRectangularAreaLights { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>If this is true, Light intensity is multiplied against linear color values. If it is false, gamma color values are used.</para>
    /// </summary>
    public static extern bool lightsUseLinearIntensity { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Whether to use a Light's color temperature when calculating the final color of that Light."</para>
    /// </summary>
    public static extern bool lightsUseColorTemperature { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Stores the default value for the RenderingLayerMask property of newly created Renderers.</para>
    /// </summary>
    public static extern uint defaultRenderingLayerMask { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Enable/Disable SRP batcher (experimental) at runtime.</para>
    /// </summary>
    public static extern bool useScriptableRenderPipelineBatching { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>If this is true, a log entry is made each time a shader is compiled at application runtime.</para>
    /// </summary>
    public static extern bool logWhenShaderIsCompiled { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Disables the built-in update loop for Custom Render Textures, so that you can write your own update loop.</para>
    /// </summary>
    public static extern bool disableBuiltinCustomRenderTextureUpdate { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>If and when to include video shaders in the build.</para>
    /// </summary>
    public static extern VideoShadersIncludeMode videoShadersIncludeMode { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Returns true if shader define was set when compiling shaders for current GraphicsTier. Graphics Tiers are only available in the Built-in Render Pipeline.</para>
    /// </summary>
    /// <param name="tier"></param>
    /// <param name="defineHash"></param>
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool HasShaderDefine(GraphicsTier tier, BuiltinShaderDefine defineHash);

    /// <summary>
    ///   <para>Returns true if shader define was set when compiling shaders for a given GraphicsTier. Graphics Tiers are only available in the Built-in Render Pipeline.</para>
    /// </summary>
    /// <param name="defineHash"></param>
    public static bool HasShaderDefine(BuiltinShaderDefine defineHash)
    {
      return GraphicsSettings.HasShaderDefine(Graphics.activeTier, defineHash);
    }

    [NativeName("CurrentRenderPipeline")]
    private static extern ScriptableObject INTERNAL_currentRenderPipeline { [MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>The RenderPipelineAsset that defines the active render pipeline for the current quality level.</para>
    /// </summary>
    public static RenderPipelineAsset currentRenderPipeline
    {
      get => GraphicsSettings.INTERNAL_currentRenderPipeline as RenderPipelineAsset;
    }

    /// <summary>
    ///   <para>Deprecated, use GraphicsSettings.defaultRenderPipeline instead.</para>
    /// </summary>
    public static RenderPipelineAsset renderPipelineAsset
    {
      get => GraphicsSettings.defaultRenderPipeline;
      set => GraphicsSettings.defaultRenderPipeline = value;
    }

    [NativeName("DefaultRenderPipeline")]
    private static extern ScriptableObject INTERNAL_defaultRenderPipeline { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The RenderPipelineAsset that defines the default render pipeline.</para>
    /// </summary>
    public static RenderPipelineAsset defaultRenderPipeline
    {
      get => GraphicsSettings.INTERNAL_defaultRenderPipeline as RenderPipelineAsset;
      set => GraphicsSettings.INTERNAL_defaultRenderPipeline = (ScriptableObject) value;
    }

    [NativeName("GetAllConfiguredRenderPipelinesForScript")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern ScriptableObject[] GetAllConfiguredRenderPipelines();

    /// <summary>
    ///   <para>An array containing the RenderPipelineAsset instances that describe the default render pipeline and any quality level overrides.</para>
    /// </summary>
    public static RenderPipelineAsset[] allConfiguredRenderPipelines
    {
      get
      {
        return GraphicsSettings.GetAllConfiguredRenderPipelines().Cast<RenderPipelineAsset>().ToArray<RenderPipelineAsset>();
      }
    }

    /// <summary>
    ///   <para>Provides a reference to the GraphicSettings object.</para>
    /// </summary>
    /// <returns>
    ///   <para>Returns the GraphicsSettings object.</para>
    /// </returns>
    [FreeFunction]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern Object GetGraphicsSettings();

    /// <summary>
    ///   <para>Set built-in shader mode.</para>
    /// </summary>
    /// <param name="type">Built-in shader type to change.</param>
    /// <param name="mode">Mode to use for built-in shader.</param>
    [NativeName("SetShaderModeScript")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void SetShaderMode(BuiltinShaderType type, BuiltinShaderMode mode);

    /// <summary>
    ///   <para>Get built-in shader mode.</para>
    /// </summary>
    /// <param name="type">Built-in shader type to query.</param>
    /// <returns>
    ///   <para>Mode used for built-in shader.</para>
    /// </returns>
    [NativeName("GetShaderModeScript")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern BuiltinShaderMode GetShaderMode(BuiltinShaderType type);

    /// <summary>
    ///   <para>Set custom shader to use instead of a built-in shader.</para>
    /// </summary>
    /// <param name="type">Built-in shader type to set custom shader to.</param>
    /// <param name="shader">The shader to use.</param>
    [NativeName("SetCustomShaderScript")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void SetCustomShader(BuiltinShaderType type, Shader shader);

    /// <summary>
    ///   <para>Get custom shader used instead of a built-in shader.</para>
    /// </summary>
    /// <param name="type">Built-in shader type to query custom shader for.</param>
    /// <returns>
    ///   <para>The shader used.</para>
    /// </returns>
    [NativeName("GetCustomShaderScript")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern Shader GetCustomShader(BuiltinShaderType type);

    public static void RegisterRenderPipelineSettings<T>(RenderPipelineGlobalSettings settings) where T : RenderPipeline
    {
      GraphicsSettings.RegisterRenderPipeline(typeof (T).FullName, (Object) settings);
    }

    [NativeName("RegisterRenderPipelineSettings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void RegisterRenderPipeline(string renderpipelineName, Object settings);

    public static void UnregisterRenderPipelineSettings<T>() where T : RenderPipeline
    {
      GraphicsSettings.UnregisterRenderPipeline(typeof (T).FullName);
    }

    [NativeName("UnregisterRenderPipelineSettings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void UnregisterRenderPipeline(string renderpipelineName);

    public static RenderPipelineGlobalSettings GetSettingsForRenderPipeline<T>() where T : RenderPipeline
    {
      return GraphicsSettings.GetSettingsForRenderPipeline(typeof (T).FullName) as RenderPipelineGlobalSettings;
    }

    [NativeName("GetSettingsForRenderPipeline")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern Object GetSettingsForRenderPipeline(string renderpipelineName);

    /// <summary>
    ///   <para>Enable or disable using the camera position as the reference point for culling lights.</para>
    /// </summary>
    public static extern bool cameraRelativeLightCulling { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Enable or disable using the camera position as the reference point for culling shadows.</para>
    /// </summary>
    public static extern bool cameraRelativeShadowCulling { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    [SpecialName]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void get_transparencySortAxis_Injected(out Vector3 ret);

    [SpecialName]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void set_transparencySortAxis_Injected(ref Vector3 value);
  }
}
